﻿@model dynamic
@{
    Layout = "";
    decimal total = 0;
}
<div  align="right">
<a class="button" href="javascript:exportar(23)" title="EXCEL">
<img src="/images/xls.png" height="14px" width="12px" alt=""/>Exportar</a>
</div>
<table class="choices" cellspacing="0">
<thead>
    <tr>
        <th>
            Tipo de solicitante
        </th>

         @foreach (orienta.Models.ORIDetCompendio idioma in ViewBag.idiomas)
         { 
        <th>
            @idioma.vNomCorto
        </th>
         }
          @foreach (orienta.Models.ORIDetCompendio idioma in ViewBag.idiomas)
         { 
        <th>
            @idioma.vNomCorto (%)
        </th>
         }
    </tr>
 </thead>
<tbody>
   @foreach (var item in Model)
   {
       total = 0;
    <tr>
        <td >
            @item.usuario
        </td>
         @foreach (orienta.Models.ORIDetCompendio idioma in ViewBag.idiomas)
         {
             dynamic columna = new System.Dynamic.ExpandoObject();
             var col = columna as IDictionary<String, object>;
             col = item;
             total = total + Int32.Parse( col[idioma.vNomCorto].ToString());
        <td>
            @col[idioma.vNomCorto]
        </td>
         }
          @foreach (orienta.Models.ORIDetCompendio idioma in ViewBag.idiomas)
         {
             dynamic columna = new System.Dynamic.ExpandoObject();
             var col = columna as IDictionary<String, object>;
             col = item;
        <td>
         @String.Format("{0:0.00%}", Int32.Parse(@col[idioma.vNomCorto].ToString()) / total)
            
        </td>
         }
    </tr>

}


</tbody>

</table>